/**
 * Copyright (C) Skywares Information Technology, LTD. 
 * All Rights Reserved.
 *
 * DynamicDataSourceContextHolder.java created on 2020年2月11日 上午11:32:47 by Lyon Lu 
 */
package com.mvc.server.dynamic.ds.config;

/**
 * <pre>
 * Description:
 * 
 * @author Lyon Lu
 * @date 2020年2月11日 上午11:32:47
 *
 * </pre>
 */
public class DynamicDataSourceContextHolder {
	
	private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<String>();
	
	/**
	 * Description:
	 * 		method description here
	 * @return String      
	 * @throws                                 
	 */
	public static String getDataSourceKey() {
		return CONTEXT_HOLDER.get();
	}

	/**
	 * Description:
	 * 		method description here
	 * @param @param key
	 * @return void      
	 * @throws
	 */
	public static void setDataSourceKey(String key) {
        CONTEXT_HOLDER.set(key);
    }
	
	/**
	 * Description:
	 * 		method description here
	 * @param 
	 * @return void      
	 * @throws
	 */
	public static void clearDataSourceKey() {
        CONTEXT_HOLDER.remove();
    }
}
